/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dairy.database;

import com.dairy.structures.*;
import java.util.ArrayList;
/**
 *
 * @author tecton
 */
public interface DatabaseInterface {
    
    public boolean insertAdmin(Admin admin);

    public boolean insertCompany(Company company);

    public boolean insertDairyproduct(Dairyproduct dairyproduct);

    public boolean insertMilkman(Milkman milkman);

    public boolean insertOrders(Orders order);

    public boolean insertSell(Sell sell);

    public boolean insertUser(User user);

    public User getUser(String username);

    public Admin getAdmin(String username);

    public Milkman getMilkman(int id);

    public Company getCompany(String username);
    
    public Milkman[] getFreeMilkman(int id_company);
    
    public boolean modifyInfo(User user);

    public boolean modifyInfo(Milkman milkman);

    public boolean modifyInfo(Company company);

    public ArrayList<Orders> getOrders(String username);

    public ArrayList<Orders> getMilkmanOrders(int job_number);

    public Orders getOrder(String username, String name);

    public int getOrderMaxID();

    public Orders[] getFreeOrder();

    public double getPrice(String name_company, String name_product);
    
    public Company[] getWholeCompany();

    public String[] getWholeCategory();

    public Dairyproduct[] getDairyProduct(int id_company, String category);

    public Dairyproduct[] getDairyProduct(String category);

    public Dairyproduct getDairyProduct(String name_company, String name_product);

    public boolean updateOrder(Orders order);

    public boolean updateProduct(Dairyproduct product);
    
    public boolean dispatch(int id_order, int job_number);

    public boolean registerUser(User newuser);
    
    public void commit();

    public boolean close();
}
